#ifndef __FLASH_MAP_H
#define __FLASH_MAP_H

#define SECTOR_SIZE    (4*1024)

#define BOOT_USER_APP1_SIGNATURE   (0xAA4D5048UL)
#define BOOT_USER_APP2_SIGNATURE   (0xBB045048UL)
#define BOOT_USER_APP_ENDMAGIC     (0xA5A55A5AUL)

#define FLASH_ADDR_BASE          (0x80000000)

#define FLASH_START_ADDR         (0 + FLASH_ADDR_BASE)                              // 0x80000000
#define FLASH_MAX_SIZE           (0x1000000)                                         // 16M

#define FLASH_BOOT_USER_ADDR     (0x3000 + FLASH_START_ADDR)                        // 0x80003000
#define FLASH_BOOT_USER_SIZE     (0xFD000)                                          //boot占约1MB

#define FLASH_USER_APP1_ADDR     (FLASH_BOOT_USER_ADDR + FLASH_BOOT_USER_SIZE)       // 0x80100000
#define FLASH_USER_APP1_SIZE     (0x700000)                                           //7MB //app占7MB

#define FLASH_USER_APP2_ADDR     (FLASH_USER_APP1_ADDR + FLASH_USER_APP1_SIZE)       // 0x80800000
#define FLASH_USER_APP2_SIZE     (0x700000)                                           //7MB //接收缓冲区占7MB

#define FLASH_APP2_HEADER_ADDR   (FLASH_USER_APP2_ADDR + FLASH_USER_APP2_SIZE)   // 0x80124000
#define FLASH_APP2_HEADER_SIZE   (0x1000)                                            // 4K

/* 并不需要
#define FLASH_USER_COMMON_ADDR   (FLASH_APP2_HEADER_ADDR + FLASH_APP2_HEADER_SIZE)   // 0x80125000
#define FLASH_USER_COMMON_SIZE   (0x80000)                                           //512K

#define FLASH_APP1_HEADER_ADDR   (FLASH_USER_APP2_ADDR + FLASH_USER_APP2_SIZE)       // 0x80123000
#define FLASH_APP1_HEADER_SIZE   (0x1000)                                            // 4K
*/

#endif //__FLASH_MAP_H